<?php
/*
 * 手机客户端 账户页面接口
 * 传入参数 
 * 2013-12-011
 */
include "inc/public_header.php";
include "inc/MiniaturePro.class.php";
include "func/user.php";				//用户信息处理函数

$reJson = array();//构建返回值

//获取用户信息
$uInfoArr = user_getInfoFromUUID();
if(!$uInfoArr){
	echo json_encode(array("success"=>"0","errCode"=>"0"));
	die;
}
$uid = $uInfoArr["uid"]; //用户信息主键
//logo显示根路径
$SHOW_IMG_BASE_URL = "http://www.chinalaohu.com//modules/miniature.php?w=150&h=150&p=/uploads/zjl_ilogo/";

//默认头像
//$LOGO_DEFAULT_PATH = "http://www.chinalaohu.com/images/zjl/zjl_i_logo_t.jpg";
 $LOGO_DEFAULT_PATH = "http://www.chinalaohu.com/images/zjl/logo_df.png";

$sql="  select 
		a.mobile,a.realname,a.ustatus,b.ilogo_path,b.nickname
    from user_base a
		LEFT JOIN new_weituo_person b on a.uid=b.uid
    where a.uid ='".$uid."'";
$db->query($sql);
while($db->next_record()){
		$realName		=	$db->f("realname");							//真实姓名
		$userIcon		=	$db->f("ilogo_path");		//头像
		$state  		=	$db->f("ustatus");							//用户状态
		$nickName   	=	$db->f("nickname");							//昵称
		$mobile 		=	$db->f("mobile");							//手机号码
		
		if($userIcon==null){
		//默认头像
			$userIcon = $LOGO_DEFAULT_PATH;
		}else{
			$userIcon= $SHOW_IMG_BASE_URL.$userIcon;
		}
		if($realName == null){
			$realName = "";
		}
		if($state == null){
			$state = "0";
		}
		if($nickName == null){
			$nickName = substr_replace($mobile,"******",3,-2);
		}
		if($mobile == null){
			$mobile = "";
		}
}


$reJson["success"]='1';
$reJson["realName"]=$realName;
$reJson["userIcon"]=$userIcon;
$reJson["state"]=$state;
$reJson["nickName"]=$nickName;
$reJson["mobile"]=substr_replace($mobile,"******",3,-2);

echo json_encode($reJson);

?>